package com.quanyan.assets.enums;


/**
 * Created by wmb on 2016/10/9.
 */
public enum CouponOrderType {
    PLACE(1,"场地预订"),
    CLUB_ACTIVITY(2,"俱乐部活动"),
    ClUB(3,"俱乐部场馆赛"),
    STADIUM(4,"百灵鸟场馆赛"),
    AUCTION(5,"约达人(魅力型)"),
    ONEPRICE(6,"约达人(实力派)"),
    TRAVEL(7,"户外运动"),
    PLACE_TICKETS(8,"场馆门票"),
    ;
    CouponOrderType(Integer id, String name){
        this.id=id;
        this.name=name;
    }

    public static String getNameById(Integer id) {
        if(null==id){
            return null;
        }
        for(CouponOrderType tmp: CouponOrderType.values()) {
            if(tmp.id.intValue() == id.intValue()) {
                return tmp.getName();
            }
        }
        return null;
    }

    public static CouponOrderType getById(Integer id) {
        if(null==id){
            return null;
        }
        for(CouponOrderType tmp: CouponOrderType.values()) {
            if(tmp.id.intValue() == id.intValue()) {
                return tmp;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer id;
    public String name;
}
